*{
    margin: 0;
    padding: 0;
}
@keyframes rotate{
    0%{
        transform: rotateY(0deg);
    }
    100%{
        transform: rotateY(180deg);
    }
}
@keyframes rotate-reverse{
    0%{
        transform: rotateY(180deg);
    }
    100%{
        transform: rotateY(0deg);
    }
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    perspective: 1000px;
    background-image: linear-gradient(200deg,rgb(216, 44, 44),rgb(97, 9, 9));
}
.card{
    transform-style: preserve-3d;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    width: 300px;
    height: 450px;
    border-radius: 30px;
    background-color: rgb(63, 5, 6);
    animation: rotate .9s cubic-bezier(0.66,-0.47,0.33,1.5) forwards;
    &:hover{
        animation: rotate-reverse .9s cubic-bezier(0.66,-0.47,0.33,1.5) forwards;
    }
    .front,
    .back{
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        left: 0;
        right: 0;
        width: 100%;
        height: 100%;
        font-size: 20px;
        color:#fff;
        backface-visibility: hidden;
    }
    .back{
        transform: rotateY(180deg);
    }
}